package com.weipai.demo.controller;

import com.weipai.demo.model.Feedback;
import com.weipai.demo.service.FeedbackService;
import com.weipai.demo.util.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 赵项阳
 * @Date: 2019/6/17 14:56
 * @Version 1.0
 */
@RestController
public class FeedbackController {

    @Autowired
    private FeedbackService feedbackService;

    //填写意见
    @RequestMapping(value = "/opinion/feedback")
    public Response feedback(Feedback feedback){

        return feedbackService.insert(feedback);
    }

    //意见反馈查看
    @RequestMapping(value = "/opinion/view",method = RequestMethod.POST)
    public Response view(Integer page,Integer size,Feedback feedback){
        return feedbackService.showFeedBack(page,size,feedback);

    }

    //删除意见反馈
    @RequestMapping(value = "/opinion/updateView")
    public Response updateView(Integer id){
        return feedbackService.updateView(id);
    }
}
